package com.codeoss.framework.model;

import java.sql.Timestamp;

import org.apache.ibatis.type.JdbcType;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.Version;
import com.codeoss.framework.json.DatetimeSerialize;
import com.codeoss.framework.mybatisplus.BooleanTypeHandler;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;

public class BaseModel {
	@TableId(type=IdType.AUTO)
	private Long id;
	@TableField(fill=FieldFill.INSERT,jdbcType=JdbcType.BIGINT)
	private Long resOrgId;
	@TableField(fill=FieldFill.INSERT,typeHandler=BooleanTypeHandler.class,jdbcType=JdbcType.VARCHAR)
	private Boolean active;
	@TableField(fill=FieldFill.INSERT,jdbcType=JdbcType.BIGINT)
	private Long createBy;
	@TableField(fill=FieldFill.INSERT,jdbcType=JdbcType.TIMESTAMP)
	@JsonSerialize(using=DatetimeSerialize.class)
	private Timestamp createDate;
	@TableField(fill=FieldFill.INSERT_UPDATE,jdbcType=JdbcType.BIGINT)
	private Long updateBy;
	@TableField(fill=FieldFill.INSERT_UPDATE,jdbcType=JdbcType.TIMESTAMP)
	@JsonSerialize(using=DatetimeSerialize.class)
	private Timestamp updateDate;
	@Version
	@TableField(fill=FieldFill.INSERT,jdbcType=JdbcType.BIGINT)
	private Long version;
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	public Long getResOrgId() {
		return resOrgId;
	}
	public void setResOrgId(Long resOrgId) {
		this.resOrgId = resOrgId;
	}
	public Boolean getActive() {
		return active;
	}
	public void setActive(Boolean active) {
		this.active = active;
	}

	public Timestamp getCreateDate() {
		return createDate;
	}
	public void setCreateDate(Timestamp createDate) {
		this.createDate = createDate;
	}
	
	public Timestamp getUpdateDate() {
		return updateDate;
	}
	public void setUpdateDate(Timestamp updateDate) {
		this.updateDate = updateDate;
	}
	public Long getVersion() {
		return version;
	}
	public void setVersion(Long version) {
		this.version = version;
	}
	public Long getCreateBy() {
		return createBy;
	}
	public void setCreateBy(Long createBy) {
		this.createBy = createBy;
	}
	public Long getUpdateBy() {
		return updateBy;
	}
	public void setUpdateBy(Long updateBy) {
		this.updateBy = updateBy;
	}
}
